package com.hsylient.javase.chapter11.demo10;

/**
 * 守护线程
 */
public class ThreadDaemon {

    public static void main(String[] args) {

        Thread syy = new Thread(() -> {
            for (int i = 0; i < 360; i++) {
                System.out.println("syy线程。。。。" + i);
            }
        }, "syy");

        Thread hsylient = new Thread(() -> {
            for (;;) {
                System.out.println("hsylient线程作为守护线程。。。。。");
            }
        }, "hsylient");
        hsylient.setDaemon(Boolean.TRUE);

        syy.start();
        hsylient.start();

    }
}
